package game;
import java.util.HashMap;

public class StrategyTable{
    public static final String HIT = "H";
    public static final String STAND = "S";
    public static final String SPLIT = "P"; //if not enough money to split: hit
    public static final String SPLIT_STAND = "PS"; //if not enough money to split: stand
    public static final String DOUBLE = "D";  //if not avaliable: hit
    public static final String DOUBLE_STAND = "DS";  //if not avaliable: stand




    public enum DealersUpcard{
        TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ACE;
    }

    public enum PlayersHand{
        FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELVE, THIRTEEN, FOURTEEN, FIFTEEN, SIXTEEN, SEVENTEEN, EIGHTTEEN, NINETEEN, TWENTY,
        A2, A3, A4, A5, A6, A7, A8, A9,
        D2, D3, D4, D5, D6, D7, D8, D9 ,D_TEN, D_ACE;
    }
    private HashMap<PlayersHand, HashMap<DealersUpcard, String>> theTable;


    //precond: 2 <= sumWithoutAce <= 9
    public String getNextMoveFromSetWithAce(int sumWithoutAce, Card.cardNumber dealersCard) {
        HashMap<DealersUpcard, String> theLine = getLineBySetWithSum(sumWithoutAce);
        return getNextMoveByDealersCard(theLine, dealersCard);
    }

    private HashMap<DealersUpcard, String> getLineBySetWithSum(int sumWithoutAce) {
        if(sumWithoutAce == 2){
            return theTable.get(PlayersHand.A2);
        } else if(sumWithoutAce == 3){
            return theTable.get(PlayersHand.A3);
        } else if(sumWithoutAce == 4){
            return theTable.get(PlayersHand.A4);
        } else if(sumWithoutAce == 5){
            return theTable.get(PlayersHand.A5);
        } else if(sumWithoutAce == 6){
            return theTable.get(PlayersHand.A6);
        } else if(sumWithoutAce == 7){
            return theTable.get(PlayersHand.A7);
        } else if(sumWithoutAce == 8){
            return theTable.get(PlayersHand.A8);
        } else if(sumWithoutAce == 9){
            return theTable.get(PlayersHand.A9);
        } else {
            //error
            return null;
        }
    }

    public String getNextMoveFromTotalNumber(PlayersHand playersHand, Card.cardNumber dealersCard) {
        HashMap<DealersUpcard, String> theLine = theTable.get(playersHand);
        return getNextMoveByDealersCard(theLine, dealersCard);
    }

    public String getNextMoveFromPair(Card.cardNumber playersCard, Card.cardNumber dealersCard) {
        HashMap<DealersUpcard, String> theLine;
        switch (playersCard) {
            case TWO:
                theLine = theTable.get(PlayersHand.D2);
                return getNextMoveByDealersCard(theLine, dealersCard);
            case THREE:
                theLine = theTable.get(PlayersHand.D3);
                return getNextMoveByDealersCard(theLine, dealersCard);
            case FOUR:
                theLine = theTable.get(PlayersHand.D4);
                return getNextMoveByDealersCard(theLine, dealersCard);
            case FIVE:
                theLine = theTable.get(PlayersHand.D5);
                return getNextMoveByDealersCard(theLine, dealersCard);
            case SIX:
                theLine = theTable.get(PlayersHand.D6);
                return getNextMoveByDealersCard(theLine, dealersCard);
            case SEVEN:
                theLine = theTable.get(PlayersHand.D7);
                return getNextMoveByDealersCard(theLine, dealersCard);
            case EIGHT:
                theLine = theTable.get(PlayersHand.D8);
                return getNextMoveByDealersCard(theLine, dealersCard);
            case NINE:
                theLine = theTable.get(PlayersHand.D9);
                return getNextMoveByDealersCard(theLine, dealersCard);
            case TEN:
                theLine = theTable.get(PlayersHand.D_TEN);
                return getNextMoveByDealersCard(theLine, dealersCard);
            case JACK:
                theLine = theTable.get(PlayersHand.D_TEN);
                return getNextMoveByDealersCard(theLine, dealersCard);
            case QUEEN:
                theLine = theTable.get(PlayersHand.D_TEN);
                return getNextMoveByDealersCard(theLine, dealersCard);
            case KING:
                theLine = theTable.get(PlayersHand.D_TEN);
                return getNextMoveByDealersCard(theLine, dealersCard);
            case ACE:
                theLine = theTable.get(PlayersHand.D_ACE);
                return getNextMoveByDealersCard(theLine, dealersCard);
            default:
                //error
                return null;
        }
    }

    private String getNextMoveByDealersCard(HashMap<DealersUpcard, String> theLine, Card.cardNumber dealersCard) {
        switch (dealersCard) {
            case TWO:
                return theLine.get(DealersUpcard.TWO);
            case THREE:
                return theLine.get(DealersUpcard.THREE);
            case FOUR:
                return theLine.get(DealersUpcard.FOUR);
            case FIVE:
                return theLine.get(DealersUpcard.FIVE);
            case SIX:
                return theLine.get(DealersUpcard.SIX);
            case SEVEN:
                return theLine.get(DealersUpcard.SEVEN);
            case EIGHT:
                return theLine.get(DealersUpcard.EIGHT);
            case NINE:
                return theLine.get(DealersUpcard.NINE);
            case TEN:
                return theLine.get(DealersUpcard.TEN);
            case JACK:
                return theLine.get(DealersUpcard.TEN);
            case QUEEN:
                return theLine.get(DealersUpcard.TEN);
            case KING:
                return theLine.get(DealersUpcard.TEN);
            case ACE:
                return theLine.get(DealersUpcard.ACE);
            default:
                //error
                return null;
        }
    }

    /////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////// THE CONSTRUCTOR/////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////////////////////////////////

    public StrategyTable() {
        theTable = new HashMap<PlayersHand, HashMap<DealersUpcard, String>>();

        HashMap<DealersUpcard, String> fiveLine = new HashMap<DealersUpcard, String>();
        fiveLine.put(DealersUpcard.TWO, HIT);
        fiveLine.put(DealersUpcard.THREE, HIT);
        fiveLine.put(DealersUpcard.FOUR, HIT);
        fiveLine.put(DealersUpcard.FIVE, HIT);
        fiveLine.put(DealersUpcard.SIX, HIT);
        fiveLine.put(DealersUpcard.SEVEN, HIT);
        fiveLine.put(DealersUpcard.EIGHT, HIT);
        fiveLine.put(DealersUpcard.NINE, HIT);
        fiveLine.put(DealersUpcard.TEN, HIT);
        fiveLine.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.FIVE, fiveLine);

        HashMap<DealersUpcard, String> sixLine = new HashMap<DealersUpcard, String>();
        sixLine.put(DealersUpcard.TWO, HIT);
        sixLine.put(DealersUpcard.THREE, HIT);
        sixLine.put(DealersUpcard.FOUR, HIT);
        sixLine.put(DealersUpcard.FIVE, HIT);
        sixLine.put(DealersUpcard.SIX, HIT);
        sixLine.put(DealersUpcard.SEVEN, HIT);
        sixLine.put(DealersUpcard.EIGHT, HIT);
        sixLine.put(DealersUpcard.NINE, HIT);
        sixLine.put(DealersUpcard.TEN, HIT);
        sixLine.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.SIX, sixLine);

        HashMap<DealersUpcard, String> sevenLine = new HashMap<DealersUpcard, String>();
        sevenLine.put(DealersUpcard.TWO, HIT);
        sevenLine.put(DealersUpcard.THREE, HIT);
        sevenLine.put(DealersUpcard.FOUR, HIT);
        sevenLine.put(DealersUpcard.FIVE, HIT);
        sevenLine.put(DealersUpcard.SIX, HIT);
        sevenLine.put(DealersUpcard.SEVEN, HIT);
        sevenLine.put(DealersUpcard.EIGHT, HIT);
        sevenLine.put(DealersUpcard.NINE, HIT);
        sevenLine.put(DealersUpcard.TEN, HIT);
        sevenLine.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.SEVEN, sevenLine);

        HashMap<DealersUpcard, String> eightLine = new HashMap<DealersUpcard, String>();
        eightLine.put(DealersUpcard.TWO, HIT);
        eightLine.put(DealersUpcard.THREE, HIT);
        eightLine.put(DealersUpcard.FOUR, HIT);
        eightLine.put(DealersUpcard.FIVE, HIT);
        eightLine.put(DealersUpcard.SIX, HIT);
        eightLine.put(DealersUpcard.SEVEN, HIT);
        eightLine.put(DealersUpcard.EIGHT, HIT);
        eightLine.put(DealersUpcard.NINE, HIT);
        eightLine.put(DealersUpcard.TEN, HIT);
        eightLine.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.EIGHT, eightLine);

        HashMap<DealersUpcard, String> nineLine = new HashMap<DealersUpcard, String>();
        nineLine.put(DealersUpcard.TWO, HIT);
        nineLine.put(DealersUpcard.THREE, DOUBLE);
        nineLine.put(DealersUpcard.FOUR, DOUBLE);
        nineLine.put(DealersUpcard.FIVE, DOUBLE);
        nineLine.put(DealersUpcard.SIX, DOUBLE);
        nineLine.put(DealersUpcard.SEVEN, HIT);
        nineLine.put(DealersUpcard.EIGHT, HIT);
        nineLine.put(DealersUpcard.NINE, HIT);
        nineLine.put(DealersUpcard.TEN, HIT);
        nineLine.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.NINE, nineLine);

        HashMap<DealersUpcard, String> tenLine = new HashMap<DealersUpcard, String>();
        tenLine.put(DealersUpcard.TWO, DOUBLE);
        tenLine.put(DealersUpcard.THREE, DOUBLE);
        tenLine.put(DealersUpcard.FOUR, DOUBLE);
        tenLine.put(DealersUpcard.FIVE, DOUBLE);
        tenLine.put(DealersUpcard.SIX, DOUBLE);
        tenLine.put(DealersUpcard.SEVEN, DOUBLE);
        tenLine.put(DealersUpcard.EIGHT, DOUBLE);
        tenLine.put(DealersUpcard.NINE, DOUBLE);
        tenLine.put(DealersUpcard.TEN, HIT);
        tenLine.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.TEN, tenLine);

        HashMap<DealersUpcard, String> elevenLine = new HashMap<DealersUpcard, String>();
        elevenLine.put(DealersUpcard.TWO, DOUBLE);
        elevenLine.put(DealersUpcard.THREE, DOUBLE);
        elevenLine.put(DealersUpcard.FOUR, DOUBLE);
        elevenLine.put(DealersUpcard.FIVE, DOUBLE);
        elevenLine.put(DealersUpcard.SIX, DOUBLE);
        elevenLine.put(DealersUpcard.SEVEN, DOUBLE);
        elevenLine.put(DealersUpcard.EIGHT, DOUBLE);
        elevenLine.put(DealersUpcard.NINE, DOUBLE);
        elevenLine.put(DealersUpcard.TEN, DOUBLE);
        elevenLine.put(DealersUpcard.ACE, DOUBLE);
        theTable.put(PlayersHand.ELEVEN, elevenLine);

        HashMap<DealersUpcard, String> twelveLine = new HashMap<DealersUpcard, String>();
        twelveLine.put(DealersUpcard.TWO, HIT);
        twelveLine.put(DealersUpcard.THREE, HIT);
        twelveLine.put(DealersUpcard.FOUR, STAND);
        twelveLine.put(DealersUpcard.FIVE, STAND);
        twelveLine.put(DealersUpcard.SIX, STAND);
        twelveLine.put(DealersUpcard.SEVEN, HIT);
        twelveLine.put(DealersUpcard.EIGHT, HIT);
        twelveLine.put(DealersUpcard.NINE, HIT);
        twelveLine.put(DealersUpcard.TEN, HIT);
        twelveLine.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.TWELVE, twelveLine);

        HashMap<DealersUpcard, String> thirteenLine = new HashMap<DealersUpcard, String>();
        thirteenLine.put(DealersUpcard.TWO, STAND);
        thirteenLine.put(DealersUpcard.THREE, STAND);
        thirteenLine.put(DealersUpcard.FOUR, STAND);
        thirteenLine.put(DealersUpcard.FIVE, STAND);
        thirteenLine.put(DealersUpcard.SIX, STAND);
        thirteenLine.put(DealersUpcard.SEVEN, HIT);
        thirteenLine.put(DealersUpcard.EIGHT, HIT);
        thirteenLine.put(DealersUpcard.NINE, HIT);
        thirteenLine.put(DealersUpcard.TEN, HIT);
        thirteenLine.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.THIRTEEN, thirteenLine);

        HashMap<DealersUpcard, String> fourteenLine = new HashMap<DealersUpcard, String>();
        fourteenLine.put(DealersUpcard.TWO, STAND);
        fourteenLine.put(DealersUpcard.THREE, STAND);
        fourteenLine.put(DealersUpcard.FOUR, STAND);
        fourteenLine.put(DealersUpcard.FIVE, STAND);
        fourteenLine.put(DealersUpcard.SIX, STAND);
        fourteenLine.put(DealersUpcard.SEVEN, HIT);
        fourteenLine.put(DealersUpcard.EIGHT, HIT);
        fourteenLine.put(DealersUpcard.NINE, HIT);
        fourteenLine.put(DealersUpcard.TEN, HIT);
        fourteenLine.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.FOURTEEN, fourteenLine);

        HashMap<DealersUpcard, String> fifteenLine = new HashMap<DealersUpcard, String>();
        fifteenLine.put(DealersUpcard.TWO, STAND);
        fifteenLine.put(DealersUpcard.THREE, STAND);
        fifteenLine.put(DealersUpcard.FOUR, STAND);
        fifteenLine.put(DealersUpcard.FIVE, STAND);
        fifteenLine.put(DealersUpcard.SIX, STAND);
        fifteenLine.put(DealersUpcard.SEVEN, HIT);
        fifteenLine.put(DealersUpcard.EIGHT, HIT);
        fifteenLine.put(DealersUpcard.NINE, HIT);
        fifteenLine.put(DealersUpcard.TEN, HIT);
        fifteenLine.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.FIFTEEN, fifteenLine);

        HashMap<DealersUpcard, String> sixteenLine = new HashMap<DealersUpcard, String>();
        sixteenLine.put(DealersUpcard.TWO, STAND);
        sixteenLine.put(DealersUpcard.THREE, STAND);
        sixteenLine.put(DealersUpcard.FOUR, STAND);
        sixteenLine.put(DealersUpcard.FIVE, STAND);
        sixteenLine.put(DealersUpcard.SIX, STAND);
        sixteenLine.put(DealersUpcard.SEVEN, HIT);
        sixteenLine.put(DealersUpcard.EIGHT, HIT);
        sixteenLine.put(DealersUpcard.NINE, HIT);
        sixteenLine.put(DealersUpcard.TEN, HIT);
        sixteenLine.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.SIXTEEN, sixteenLine);

        HashMap<DealersUpcard, String> seventeenLine = new HashMap<DealersUpcard, String>();
        seventeenLine.put(DealersUpcard.TWO, STAND);
        seventeenLine.put(DealersUpcard.THREE, STAND);
        seventeenLine.put(DealersUpcard.FOUR, STAND);
        seventeenLine.put(DealersUpcard.FIVE, STAND);
        seventeenLine.put(DealersUpcard.SIX, STAND);
        seventeenLine.put(DealersUpcard.SEVEN, STAND);
        seventeenLine.put(DealersUpcard.EIGHT, STAND);
        seventeenLine.put(DealersUpcard.NINE, STAND);
        seventeenLine.put(DealersUpcard.TEN, STAND);
        seventeenLine.put(DealersUpcard.ACE, STAND);
        theTable.put(PlayersHand.SEVENTEEN, seventeenLine);

        HashMap<DealersUpcard, String> eightteenLine = new HashMap<DealersUpcard, String>();
        eightteenLine.put(DealersUpcard.TWO, STAND);
        eightteenLine.put(DealersUpcard.THREE, STAND);
        eightteenLine.put(DealersUpcard.FOUR, STAND);
        eightteenLine.put(DealersUpcard.FIVE, STAND);
        eightteenLine.put(DealersUpcard.SIX, STAND);
        eightteenLine.put(DealersUpcard.SEVEN, STAND);
        eightteenLine.put(DealersUpcard.EIGHT, STAND);
        eightteenLine.put(DealersUpcard.NINE, STAND);
        eightteenLine.put(DealersUpcard.TEN, STAND);
        eightteenLine.put(DealersUpcard.ACE, STAND);
        theTable.put(PlayersHand.EIGHTTEEN, eightteenLine);

        HashMap<DealersUpcard, String> nineteenLine = new HashMap<DealersUpcard, String>();
        nineteenLine.put(DealersUpcard.TWO, STAND);
        nineteenLine.put(DealersUpcard.THREE, STAND);
        nineteenLine.put(DealersUpcard.FOUR, STAND);
        nineteenLine.put(DealersUpcard.FIVE, STAND);
        nineteenLine.put(DealersUpcard.SIX, STAND);
        nineteenLine.put(DealersUpcard.SEVEN, STAND);
        nineteenLine.put(DealersUpcard.EIGHT, STAND);
        nineteenLine.put(DealersUpcard.NINE, STAND);
        nineteenLine.put(DealersUpcard.TEN, STAND);
        nineteenLine.put(DealersUpcard.ACE, STAND);
        theTable.put(PlayersHand.NINETEEN, nineteenLine);

        HashMap<DealersUpcard, String> twentyLine = new HashMap<DealersUpcard, String>();
        twentyLine.put(DealersUpcard.TWO, STAND);
        twentyLine.put(DealersUpcard.THREE, STAND);
        twentyLine.put(DealersUpcard.FOUR, STAND);
        twentyLine.put(DealersUpcard.FIVE, STAND);
        twentyLine.put(DealersUpcard.SIX, STAND);
        twentyLine.put(DealersUpcard.SEVEN, STAND);
        twentyLine.put(DealersUpcard.EIGHT, STAND);
        twentyLine.put(DealersUpcard.NINE, STAND);
        twentyLine.put(DealersUpcard.TEN, STAND);
        twentyLine.put(DealersUpcard.ACE, STAND);
        theTable.put(PlayersHand.TWENTY, twentyLine);

        HashMap<DealersUpcard, String> a2Line = new HashMap<DealersUpcard, String>();
        a2Line.put(DealersUpcard.TWO, HIT);
        a2Line.put(DealersUpcard.THREE, HIT);
        a2Line.put(DealersUpcard.FOUR, HIT);
        a2Line.put(DealersUpcard.FIVE, DOUBLE);
        a2Line.put(DealersUpcard.SIX, DOUBLE);
        a2Line.put(DealersUpcard.SEVEN, HIT);
        a2Line.put(DealersUpcard.EIGHT, HIT);
        a2Line.put(DealersUpcard.NINE, HIT);
        a2Line.put(DealersUpcard.TEN, HIT);
        a2Line.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.A2, a2Line);

        HashMap<DealersUpcard, String> a3Line = new HashMap<DealersUpcard, String>();
        a3Line.put(DealersUpcard.TWO, HIT);
        a3Line.put(DealersUpcard.THREE, HIT);
        a3Line.put(DealersUpcard.FOUR, HIT);
        a3Line.put(DealersUpcard.FIVE, DOUBLE);
        a3Line.put(DealersUpcard.SIX, DOUBLE);
        a3Line.put(DealersUpcard.SEVEN, HIT);
        a3Line.put(DealersUpcard.EIGHT, HIT);
        a3Line.put(DealersUpcard.NINE, HIT);
        a3Line.put(DealersUpcard.TEN, HIT);
        a3Line.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.A3, a3Line);

        HashMap<DealersUpcard, String> a4Line = new HashMap<DealersUpcard, String>();
        a4Line.put(DealersUpcard.TWO, HIT);
        a4Line.put(DealersUpcard.THREE, HIT);
        a4Line.put(DealersUpcard.FOUR, DOUBLE);
        a4Line.put(DealersUpcard.FIVE, DOUBLE);
        a4Line.put(DealersUpcard.SIX, DOUBLE);
        a4Line.put(DealersUpcard.SEVEN, HIT);
        a4Line.put(DealersUpcard.EIGHT, HIT);
        a4Line.put(DealersUpcard.NINE, HIT);
        a4Line.put(DealersUpcard.TEN, HIT);
        a4Line.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.A4, a4Line);

        HashMap<DealersUpcard, String> a5Line = new HashMap<DealersUpcard, String>();
        a5Line.put(DealersUpcard.TWO, HIT);
        a5Line.put(DealersUpcard.THREE, HIT);
        a5Line.put(DealersUpcard.FOUR, DOUBLE);
        a5Line.put(DealersUpcard.FIVE, DOUBLE);
        a5Line.put(DealersUpcard.SIX, DOUBLE);
        a5Line.put(DealersUpcard.SEVEN, HIT);
        a5Line.put(DealersUpcard.EIGHT, HIT);
        a5Line.put(DealersUpcard.NINE, HIT);
        a5Line.put(DealersUpcard.TEN, HIT);
        a5Line.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.A5, a5Line);

        HashMap<DealersUpcard, String> a6Line = new HashMap<DealersUpcard, String>();
        a6Line.put(DealersUpcard.TWO, HIT);
        a6Line.put(DealersUpcard.THREE, DOUBLE);
        a6Line.put(DealersUpcard.FOUR, DOUBLE);
        a6Line.put(DealersUpcard.FIVE, DOUBLE);
        a6Line.put(DealersUpcard.SIX, DOUBLE);
        a6Line.put(DealersUpcard.SEVEN, HIT);
        a6Line.put(DealersUpcard.EIGHT, HIT);
        a6Line.put(DealersUpcard.NINE, HIT);
        a6Line.put(DealersUpcard.TEN, HIT);
        a6Line.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.A6, a6Line);

        HashMap<DealersUpcard, String> a7Line = new HashMap<DealersUpcard, String>();
        a7Line.put(DealersUpcard.TWO, DOUBLE_STAND);
        a7Line.put(DealersUpcard.THREE, DOUBLE_STAND);
        a7Line.put(DealersUpcard.FOUR, DOUBLE_STAND);
        a7Line.put(DealersUpcard.FIVE, DOUBLE_STAND);
        a7Line.put(DealersUpcard.SIX, DOUBLE_STAND);
        a7Line.put(DealersUpcard.SEVEN, STAND);
        a7Line.put(DealersUpcard.EIGHT, STAND);
        a7Line.put(DealersUpcard.NINE, HIT);
        a7Line.put(DealersUpcard.TEN, HIT);
        a7Line.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.A7, a7Line);

        HashMap<DealersUpcard, String> a8Line = new HashMap<DealersUpcard, String>();
        a8Line.put(DealersUpcard.TWO, STAND);
        a8Line.put(DealersUpcard.THREE, STAND);
        a8Line.put(DealersUpcard.FOUR, STAND);
        a8Line.put(DealersUpcard.FIVE, STAND);
        a8Line.put(DealersUpcard.SIX, DOUBLE_STAND);
        a8Line.put(DealersUpcard.SEVEN, STAND);
        a8Line.put(DealersUpcard.EIGHT, STAND);
        a8Line.put(DealersUpcard.NINE, STAND);
        a8Line.put(DealersUpcard.TEN, STAND);
        a8Line.put(DealersUpcard.ACE, STAND);
        theTable.put(PlayersHand.A8, a8Line);

        HashMap<DealersUpcard, String> a9Line = new HashMap<DealersUpcard, String>();
        a9Line.put(DealersUpcard.TWO, STAND);
        a9Line.put(DealersUpcard.THREE, STAND);
        a9Line.put(DealersUpcard.FOUR, STAND);
        a9Line.put(DealersUpcard.FIVE, STAND);
        a9Line.put(DealersUpcard.SIX, STAND);
        a9Line.put(DealersUpcard.SEVEN, STAND);
        a9Line.put(DealersUpcard.EIGHT, STAND);
        a9Line.put(DealersUpcard.NINE, STAND);
        a9Line.put(DealersUpcard.TEN, STAND);
        a9Line.put(DealersUpcard.ACE, STAND);
        theTable.put(PlayersHand.A9, a9Line);

        HashMap<DealersUpcard, String> d2Line = new HashMap<DealersUpcard, String>();
        d2Line.put(DealersUpcard.TWO, SPLIT);
        d2Line.put(DealersUpcard.THREE, SPLIT);
        d2Line.put(DealersUpcard.FOUR, SPLIT);
        d2Line.put(DealersUpcard.FIVE, SPLIT);
        d2Line.put(DealersUpcard.SIX, SPLIT);
        d2Line.put(DealersUpcard.SEVEN, SPLIT);
        d2Line.put(DealersUpcard.EIGHT, HIT);
        d2Line.put(DealersUpcard.NINE, HIT);
        d2Line.put(DealersUpcard.TEN, HIT);
        d2Line.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.D2, d2Line);

        HashMap<DealersUpcard, String> d3Line = new HashMap<DealersUpcard, String>();
        d3Line.put(DealersUpcard.TWO, SPLIT);
        d3Line.put(DealersUpcard.THREE, SPLIT);
        d3Line.put(DealersUpcard.FOUR, SPLIT);
        d3Line.put(DealersUpcard.FIVE, SPLIT);
        d3Line.put(DealersUpcard.SIX, SPLIT);
        d3Line.put(DealersUpcard.SEVEN, SPLIT);
        d3Line.put(DealersUpcard.EIGHT, HIT);
        d3Line.put(DealersUpcard.NINE, HIT);
        d3Line.put(DealersUpcard.TEN, HIT);
        d3Line.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.D3, d3Line);

        HashMap<DealersUpcard, String> d4Line = new HashMap<DealersUpcard, String>();
        d4Line.put(DealersUpcard.TWO, HIT);
        d4Line.put(DealersUpcard.THREE, HIT);
        d4Line.put(DealersUpcard.FOUR, HIT);
        d4Line.put(DealersUpcard.FIVE, SPLIT);
        d4Line.put(DealersUpcard.SIX, SPLIT);
        d4Line.put(DealersUpcard.SEVEN, HIT);
        d4Line.put(DealersUpcard.EIGHT, HIT);
        d4Line.put(DealersUpcard.NINE, HIT);
        d4Line.put(DealersUpcard.TEN, HIT);
        d4Line.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.D4, d4Line);

        HashMap<DealersUpcard, String> d5Line = new HashMap<DealersUpcard, String>();
        d5Line.put(DealersUpcard.TWO, DOUBLE);
        d5Line.put(DealersUpcard.THREE, DOUBLE);
        d5Line.put(DealersUpcard.FOUR, DOUBLE);
        d5Line.put(DealersUpcard.FIVE, DOUBLE);
        d5Line.put(DealersUpcard.SIX, DOUBLE);
        d5Line.put(DealersUpcard.SEVEN, DOUBLE);
        d5Line.put(DealersUpcard.EIGHT, DOUBLE);
        d5Line.put(DealersUpcard.NINE, DOUBLE);
        d5Line.put(DealersUpcard.TEN, HIT);
        d5Line.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.D5, d5Line);

        HashMap<DealersUpcard, String> d6Line = new HashMap<DealersUpcard, String>();
        d6Line.put(DealersUpcard.TWO, SPLIT);
        d6Line.put(DealersUpcard.THREE, SPLIT);
        d6Line.put(DealersUpcard.FOUR, SPLIT_STAND);
        d6Line.put(DealersUpcard.FIVE, SPLIT_STAND);
        d6Line.put(DealersUpcard.SIX, SPLIT_STAND);
        d6Line.put(DealersUpcard.SEVEN, HIT);
        d6Line.put(DealersUpcard.EIGHT, HIT);
        d6Line.put(DealersUpcard.NINE, HIT);
        d6Line.put(DealersUpcard.TEN, HIT);
        d6Line.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.D6, d6Line);

        HashMap<DealersUpcard, String> d7Line = new HashMap<DealersUpcard, String>();
        d7Line.put(DealersUpcard.TWO, SPLIT_STAND);
        d7Line.put(DealersUpcard.THREE, SPLIT_STAND);
        d7Line.put(DealersUpcard.FOUR, SPLIT_STAND);
        d7Line.put(DealersUpcard.FIVE, SPLIT_STAND);
        d7Line.put(DealersUpcard.SIX, SPLIT_STAND);
        d7Line.put(DealersUpcard.SEVEN, SPLIT);
        d7Line.put(DealersUpcard.EIGHT, HIT);
        d7Line.put(DealersUpcard.NINE, HIT);
        d7Line.put(DealersUpcard.TEN, HIT);
        d7Line.put(DealersUpcard.ACE, HIT);
        theTable.put(PlayersHand.D7, d7Line);

        HashMap<DealersUpcard, String> d8Line = new HashMap<DealersUpcard, String>();
        d8Line.put(DealersUpcard.TWO, SPLIT_STAND);
        d8Line.put(DealersUpcard.THREE, SPLIT_STAND);
        d8Line.put(DealersUpcard.FOUR, SPLIT_STAND);
        d8Line.put(DealersUpcard.FIVE, SPLIT_STAND);
        d8Line.put(DealersUpcard.SIX, SPLIT_STAND);
        d8Line.put(DealersUpcard.SEVEN, SPLIT);
        d8Line.put(DealersUpcard.EIGHT, SPLIT);
        d8Line.put(DealersUpcard.NINE, SPLIT);
        d8Line.put(DealersUpcard.TEN, SPLIT);
        d8Line.put(DealersUpcard.ACE, SPLIT);
        theTable.put(PlayersHand.D8, d8Line);

        HashMap<DealersUpcard, String> d9Line = new HashMap<DealersUpcard, String>();
        d9Line.put(DealersUpcard.TWO, SPLIT_STAND);
        d9Line.put(DealersUpcard.THREE, SPLIT_STAND);
        d9Line.put(DealersUpcard.FOUR, SPLIT_STAND);
        d9Line.put(DealersUpcard.FIVE, SPLIT_STAND);
        d9Line.put(DealersUpcard.SIX, SPLIT_STAND);
        d9Line.put(DealersUpcard.SEVEN, STAND);
        d9Line.put(DealersUpcard.EIGHT, SPLIT_STAND);
        d9Line.put(DealersUpcard.NINE, SPLIT_STAND);
        d9Line.put(DealersUpcard.TEN, STAND);
        d9Line.put(DealersUpcard.ACE, STAND);
        theTable.put(PlayersHand.D9, d9Line);

        HashMap<DealersUpcard, String> d10Line = new HashMap<DealersUpcard, String>();
        d10Line.put(DealersUpcard.TWO, STAND);
        d10Line.put(DealersUpcard.THREE, STAND);
        d10Line.put(DealersUpcard.FOUR, STAND);
        d10Line.put(DealersUpcard.FIVE, STAND);
        d10Line.put(DealersUpcard.SIX, STAND);
        d10Line.put(DealersUpcard.SEVEN, STAND);
        d10Line.put(DealersUpcard.EIGHT, STAND);
        d10Line.put(DealersUpcard.NINE, STAND);
        d10Line.put(DealersUpcard.TEN, STAND);
        d10Line.put(DealersUpcard.ACE, STAND);
        theTable.put(PlayersHand.D_TEN, d10Line);

        HashMap<DealersUpcard, String> dAceLine = new HashMap<DealersUpcard, String>();
        dAceLine.put(DealersUpcard.TWO, SPLIT);
        dAceLine.put(DealersUpcard.THREE, SPLIT);
        dAceLine.put(DealersUpcard.FOUR, SPLIT);
        dAceLine.put(DealersUpcard.FIVE, SPLIT);
        dAceLine.put(DealersUpcard.SIX, SPLIT);
        dAceLine.put(DealersUpcard.SEVEN, SPLIT);
        dAceLine.put(DealersUpcard.EIGHT, SPLIT);
        dAceLine.put(DealersUpcard.NINE, SPLIT);
        dAceLine.put(DealersUpcard.TEN, SPLIT);
        dAceLine.put(DealersUpcard.ACE, SPLIT);
        theTable.put(PlayersHand.D_ACE, dAceLine);
    }

}